package github.kawaiior.yuanchuxiuzhen.common.herb;

import github.kawaiior.yuanchuxiuzhen.common.capability.entity.ManaPower;
import github.kawaiior.yuanchuxiuzhen.core.registry.ModCapability;
import github.kawaiior.yuanchuxiuzhen.util.EntityUtil;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.potion.Effects;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.common.util.LazyOptional;

public class HerbEffect_18 implements IHerbEffect{

    @Override
    public void onPlayerUse(PlayerEntity player, byte fireLevel, byte randomLevel) {
        LazyOptional<ManaPower> capability = player.getCapability(ModCapability.MANA_POWER);
        capability.ifPresent((power)->{
            power.addHealth((int)(5.1F+0.8F*fireLevel+0.3F*randomLevel));
        });
    }

    @Override
    public TranslationTextComponent getHerbEffectTextComponent(byte fireLevel, byte randomLevel) {
        return new TranslationTextComponent("pellet.effect.18", (int)(5.1F+0.8F*fireLevel+0.3F*randomLevel));
    }
}